class code1_1 {
    public void moveZeroes(int[] nums) {
        int i = 0;//i之后的都是0
        int j = 0;
        while(j < nums.length) {
            if(nums[j] != 0) {
                //非0保持顺序
                nums[i++] = nums[j];
            }
            j++;
        }
        //i之后的都赋值为0
        while(i < j) {
            nums[i++] = 0;
        }

    }
}